package cn.itsource.service.Impl;

import cn.itsource.domain.Emp;
import cn.itsource.mapper.EmpMapper;
import cn.itsource.service.IEmpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository
public class IEmpServiceImpl implements IEmpService {
    @Autowired
    private EmpMapper mapper;
    public List<Emp> findAll() {
        return mapper.findAll();
    }

    public void delById(Integer eid) {
        mapper.delById(eid);
    }

    public void save(Emp emp) {
        if(emp.getEid()==null){
            mapper.add(emp);
        }else {
            mapper.update(emp);
        }
    }
}
